<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <link th:href="@{/c/base.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/c/toefl.css}" rel="stylesheet" type="text/css">
</head>

<body>

<div class="openMenu">
    <div class="doc1180">
        <ul class="fn-clear">
            <li class="openMenuOn"><a th:href="@{/open-course/new-openCourse}" target="publicIfr">最新公开课</a></li>
            <li><a th:href="@{/open-course/rf-teachers}" target="publicIfr">名师推荐</a></li>
        </ul>
    </div>
</div>

<iframe id="publicIfr" name='publicIfr' th:src="@{/open-course/new-openCourse}" style="width: 99vw;height: 84vh;"
        frameborder="no"></iframe>


<script type="text/javascript">
    // 计算页面的实际高度，iframe自适应会用到
    function calcPageHeight(doc) {
        var cHeight = Math.max(doc.body.clientHeight, doc.documentElement.clientHeight);
        var sHeight = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight);
        var height = Math.max(doc.body.clientHeight, doc.body.scrollHeight);
        return height
    }

    var ifr = document.getElementById('publicIfr')
    ifr.onload = function () {
        var inter = window.setInterval(function () {
            var iDoc = ifr.contentDocument || ifr.document
            var height = calcPageHeight(iDoc)
            ifr.style.height = height + 'px'

        }, 100);
        window.setTimeout(function () {
            window.clearInterval(inter);
        }, 10000);

    }
</script>


</body>
</html>
